<?php

class NewBugCommentForm extends BaseFormDoctrine
{
	public function configure()
	{
		$this->setWidgets(array(
			'id'         => new sfWidgetFormInputHidden(),
			'content'    => new sfWidgetFormTextarea(),
			'actions'    => new sfWidgetFormInputHidden(),
			'user_id'    => new sfWidgetFormInputHidden(),
			'bug_id'     => new sfWidgetFormInputHidden(),
		));
		
		$this->setValidators(array(
			'id'         => new sfValidatorDoctrineChoice(array('model' => 'BugComment', 'column' => 'id', 'required' => false)),
			'content'    => new sfValidatorString(array('min_length' => 20)),
			'actions'    => new sfValidatorString(array('required' => false)),
			'user_id'    => new sfValidatorDoctrineChoice(array('model' => 'User')),
			'bug_id'     => new sfValidatorDoctrineChoice(array('model' => 'Bug')),
		));
		
		$this->widgetSchema->setLabels(array(
			'content'    => 'Add a comment:'
		));
		
		$this->widgetSchema->setNameFormat('bug_comment[%s]');
		
		$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
		
		parent::setup();
	}
	
	public function getModelName()
	{
		return 'BugComment';
	}
}

?>